#include "mywindow.h"
#include <QVBoxLayout>
#include <QDebug>
#include <QColorDialog>

MyWindow::MyWindow(QWidget *parent) :
    QWidget(parent)
{
    m_button = new QPushButton("push",this);
    m_label = new QLabel("???",this);

    setLayout(new QVBoxLayout());
    layout()->addWidget(m_button);
    layout()->addWidget(m_label);

    connect(m_button,SIGNAL(clicked()),
            this, SLOT(myAction()));

}

void MyWindow::myAction()
{
    QColorDialog d(this);
    d.exec();

    m_label->setText(d.currentColor().name());
}
